package de.luh.slimpp.generator

import de.luh.slimpp.slimPP.ClassDefinition
import java.util.ArrayList
import java.util.HashSet
import java.util.LinkedHashSet
import java.util.List

class EnhancedClass {
	public val ClassDefinition original
	public val superclasses = new HashSet<EnhancedClass>
	public val subclasses = new HashSet<EnhancedClass>
	public val methods = new ArrayList<EnhancedMethod>
//	public val methods = new LinkedHashSet<EnhancedMethod>
	public val typedefs = new ArrayList<String>
	public val unimplementedPureVirtualMethods = new ArrayList<EnhancedMethod>
	public val includes = new LinkedHashSet<String>

	new(ClassDefinition original) {
		this.original = original
	}

	def List<EnhancedClass> allSuperClasses() {
		if (superclasses.empty) {
			return emptyList
		} else {
			val list = new ArrayList<EnhancedClass>
			list.addAll(superclasses)
			superclasses.forEach[list.addAll(it.allSuperClasses)]
			return list
		}
	}

	def List<EnhancedClass> allSubClasses() {
		if (subclasses.empty) {
			return emptyList
		} else {
			val list = new ArrayList<EnhancedClass>
			list.addAll(subclasses)
			subclasses.forEach[list.addAll(it.allSubClasses)]
			return list
		}
	}
}